package com.visizen.wisdomclass.server.client;

import com.visizen.wisdomclass.server.model.WcLocateSet;
import com.visizen.wisdomclass.server.model.WcLocateSetExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

public interface WcLocateSetMapper {
    @SelectProvider(type=WcLocateSetSqlProvider.class, method="countByExample")
    int countByExample(WcLocateSetExample example);

    @DeleteProvider(type=WcLocateSetSqlProvider.class, method="deleteByExample")
    int deleteByExample(WcLocateSetExample example);

    @Delete({
        "delete from wc_locate_set",
        "where USER_ID = #{USER_ID,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long USER_ID);

    @Insert({
        "insert into wc_locate_set (USER_ID, INTE, ",
        "BEGIN_TIME, END_TIME)",
        "values (#{USER_ID,jdbcType=BIGINT}, #{INTE,jdbcType=INTEGER}, ",
        "#{BEGIN_TIME,jdbcType=TIMESTAMP}, #{END_TIME,jdbcType=TIMESTAMP})"
    })
    int insert(WcLocateSet record);

    @InsertProvider(type=WcLocateSetSqlProvider.class, method="insertSelective")
    int insertSelective(WcLocateSet record);

    @SelectProvider(type=WcLocateSetSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="USER_ID", property="USER_ID", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="INTE", property="INTE", jdbcType=JdbcType.INTEGER),
        @Result(column="BEGIN_TIME", property="BEGIN_TIME", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="END_TIME", property="END_TIME", jdbcType=JdbcType.TIMESTAMP)
    })
    List<WcLocateSet> selectByExample(WcLocateSetExample example);

    @Select({
        "select",
        "USER_ID, INTE, BEGIN_TIME, END_TIME",
        "from wc_locate_set",
        "where USER_ID = #{USER_ID,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="USER_ID", property="USER_ID", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="INTE", property="INTE", jdbcType=JdbcType.INTEGER),
        @Result(column="BEGIN_TIME", property="BEGIN_TIME", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="END_TIME", property="END_TIME", jdbcType=JdbcType.TIMESTAMP)
    })
    WcLocateSet selectByPrimaryKey(Long USER_ID);

    @UpdateProvider(type=WcLocateSetSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") WcLocateSet record, @Param("example") WcLocateSetExample example);

    @UpdateProvider(type=WcLocateSetSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") WcLocateSet record, @Param("example") WcLocateSetExample example);

    @UpdateProvider(type=WcLocateSetSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(WcLocateSet record);

    @Update({
        "update wc_locate_set",
        "set INTE = #{INTE,jdbcType=INTEGER},",
          "BEGIN_TIME = #{BEGIN_TIME,jdbcType=TIMESTAMP},",
          "END_TIME = #{END_TIME,jdbcType=TIMESTAMP}",
        "where USER_ID = #{USER_ID,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(WcLocateSet record);
}